﻿#ifndef CHMSNETWORKBASE_H
#define CHMSNETWORKBASE_H

// #include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <stdio.h>

#pragma comment(lib,"Ws2_32.lib")

class ChMSNetWorkBase
{
public:
    ChMSNetWorkBase();
    ~ChMSNetWorkBase();

    /*
     * 初始化 Winsock
     * */
    static void funCreateSocket();
    WSADATA wsaData;
    //int iResult = 0;
    int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);

    /*
     * 对象计数器取数函数
     * */
    static int sFunGetCounter();
    /*
     * 重载 new delete
     * */
    void *operator new(size_t s);
    void *operator new(size_t s,void *p);
    void operator delete(void *ptr);

private:
    // 对象计数器
    static int sNewCounter;

};

class QChMSNetWorkBase
{
public:
    QChMSNetWorkBase();
    ~QChMSNetWorkBase();

};

#endif // CHMSNETWORKBASE_H
